package com.sixth.dao;

import com.sixth.entity.User;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface UserDao {
    int deleteByPrimaryKey(Integer userid);

    int insert(User record);

    int insertSelective(User record);

    User selectByPrimaryKey(Integer userid);

    int updateByPrimaryKeySelective(User record);

    int updateByPrimaryKey(User record);

    //登录
    User findByNameAndPwd(@Param("loginname") String loginname,@Param("pwd") String pwd);
    //模糊查询用户
    List<User> listByCondition(@Param("realname") String realname, @Param("loginname") String loginname, @Param("address") String address, @Param("phone") String phone, @Param("identity") String identity, @Param("sex") Integer sex);
    //添加用户
    int adduser(@Param("loginname")String loginname,@Param("identity") String identity,@Param("realname") String realname,@Param("sex") Integer sex,@Param("address") String address,@Param("phone") String phone,@Param("pwd") String pwd, @Param("position")String position,@Param("type") Integer type);
    //修改用户信息
    int update(@Param("loginname")String loginname, @Param("identity")String identity,@Param("realname") String realname,@Param("sex") Integer sex, @Param("address")String address,@Param("phone") String phone,@Param("type")  Integer type,@Param("userid")  Integer userid);

    //修改密码
    int uppwd(@Param("pwd") String pwd,@Param("userid") Integer userid);

    //角色分配
    int uprole(@Param("roleid") Integer roleid,@Param("userid") Integer userid);

    //批量删除
    int dels(@Param("uid")Integer uid);
}